<template>
    <div>
        <van-nav-bar
  title="地址列表"
  left-text="返回"
  left-arrow
  @click-left="()=>{$router.push('/js')}"
/>
<van-address-list
  v-model="chosenAddressId"
  :list="list"

  default-tag-text="默认"
  @add="onAdd"
  @edit="onEdit"
/>

    </div>
</template>

<script setup>
import { ref } from 'vue';
import { showToast } from 'vant';
import { useRouter } from 'vue-router';
const router=useRouter()
  const chosenAddressId = ref('1');
    const list = [
      {
        id: '1',
        name: '张三',
        tel: '13000000000',
        address: '浙江省杭州市西湖区文三路 138 号东方通信大厦 7 楼 501 室',
        isDefault: true,
      },
    
    ];
    const onAdd = () =>{
        // showToast('新增地址');
router.push('/tjdz')
        }
    const onEdit = (item, index) => {
        // showToast('编辑地址:' + index);
router.push('/tjdz')
        }
</script>

<style lang="scss" scoped>

</style>